/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Entity;

import java.io.Serializable;
import java.math.BigInteger;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author guillaumediliberatore
 */
@Entity
@Table(name = "sinistre")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Sinistre.findAll", query = "SELECT s FROM Sinistre s"),
    @NamedQuery(name = "Sinistre.findByNumerosinistre", query = "SELECT s FROM Sinistre s WHERE s.numerosinistre = :numerosinistre"),
    @NamedQuery(name = "Sinistre.findByMontantdegat", query = "SELECT s FROM Sinistre s WHERE s.montantdegat = :montantdegat"),
    @NamedQuery(name = "Sinistre.findByDescription", query = "SELECT s FROM Sinistre s WHERE s.description = :description"),
    @NamedQuery(name = "Sinistre.findByNumcontrat", query = "SELECT s FROM Sinistre s WHERE s.numcontrat = :numcontrat"),
    @NamedQuery(name = "Sinistre.findByNumexpert", query = "SELECT s FROM Sinistre s WHERE s.numexpert = :numexpert"),
    @NamedQuery(name = "Sinistre.findByNumredacteur", query = "SELECT s FROM Sinistre s WHERE s.numredacteur = :numredacteur"),
    @NamedQuery(name = "Sinistre.findByMontantremboursement", query = "SELECT s FROM Sinistre s WHERE s.montantremboursement = :montantremboursement"),
    @NamedQuery(name = "Sinistre.findByStatut", query = "SELECT s FROM Sinistre s WHERE s.statut = :statut"),
    @NamedQuery(name = "Sinistre.findByLieu", query = "SELECT s FROM Sinistre s WHERE s.lieu = :lieu"),
    @NamedQuery(name = "Sinistre.findByDate", query = "SELECT s FROM Sinistre s WHERE s.date = :date")})
public class Sinistre implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "numerosinistre")
    private Integer numerosinistre;
    @Column(name = "montantdegat")
    private BigInteger montantdegat;
    @Size(max = 500)
    @Column(name = "description")
    private String description;
    @Size(max = 50)
    @Column(name = "numcontrat")
    private String numcontrat;
    @Size(max = 50)
    @Column(name = "numexpert")
    private String numexpert;
    @Size(max = 50)
    @Column(name = "numredacteur")
    private String numredacteur;
    @Column(name = "montantremboursement")
    private BigInteger montantremboursement;
    @Size(max = 30)
    @Column(name = "statut")
    private String statut;
    @Size(max = 2147483647)
    @Column(name = "lieu")
    private String lieu;
    @Size(max = 40)
    @Column(name = "date")
    private String date;

    public Sinistre() {
    }

       public Sinistre(String numcontrat, String date, String adresse, String description){
        this.numcontrat=numcontrat;
        this.date=date;
        lieu=adresse;
        this.description=description;
       }
    public Sinistre(Integer numerosinistre) {
        this.numerosinistre = numerosinistre;
    }

    public Integer getNumerosinistre() {
        return numerosinistre;
    }

    public void setNumerosinistre(Integer numerosinistre) {
        this.numerosinistre = numerosinistre;
    }

    public BigInteger getMontantdegat() {
        return montantdegat;
    }

    public void setMontantdegat(BigInteger montantdegat) {
        this.montantdegat = montantdegat;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getNumcontrat() {
        return numcontrat;
    }

    public void setNumcontrat(String numcontrat) {
        this.numcontrat = numcontrat;
    }

    public String getNumexpert() {
        return numexpert;
    }

    public void setNumexpert(String numexpert) {
        this.numexpert = numexpert;
    }

    public String getNumredacteur() {
        return numredacteur;
    }

    public void setNumredacteur(String numredacteur) {
        this.numredacteur = numredacteur;
    }

    public BigInteger getMontantremboursement() {
        return montantremboursement;
    }

    public void setMontantremboursement(BigInteger montantremboursement) {
        this.montantremboursement = montantremboursement;
    }

    public String getStatut() {
        return statut;
    }

    public void setStatut(String statut) {
        this.statut = statut;
    }

    public String getLieu() {
        return lieu;
    }

    public void setLieu(String lieu) {
        this.lieu = lieu;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (numerosinistre != null ? numerosinistre.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Sinistre)) {
            return false;
        }
        Sinistre other = (Sinistre) object;
        if ((this.numerosinistre == null && other.numerosinistre != null) || (this.numerosinistre != null && !this.numerosinistre.equals(other.numerosinistre))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entity.Sinistre[ numerosinistre=" + numerosinistre + " ]";
    }
    
}
